package com.education.expenses.assembler;

import com.education.expenses.common.dto.ReceiptDTO;
import com.education.expenses.entity.Receipt;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Blackhard27
 * Date: 08.08.12
 * Time: 13:39
 * To change this template use File | Settings | File Templates.
 */
@Component
public class ReceiptAssembler extends GenericAssembler<Receipt, ReceiptDTO> {

    @Override
    public ReceiptDTO toDTO(Receipt entity) {
        return super.toDTO(entity);
    }

    public List<ReceiptDTO> toListDTO(List<Receipt> receipts){
        List<ReceiptDTO> list = new ArrayList<ReceiptDTO>();
        for(Receipt receipt: receipts){
            list.add(toDTO(receipt));
        }
        return list;
    }
}
